<%@ include file="/common/taglibs.jsp"%>

<head>
<title><fmt:message key="createDeath.title" /></title>
<script type="text/javascript" src="scripts/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="scripts/datetimepicker.js">
	//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
	//Script featured on JavaScript Kit (http://www.javascriptkit.com)
	//For this script, visit http://www.javascriptkit.com
</script>
<script type="text/javascript">
	function confirmSave(obj) {
		var msg = "Are you sure you want to submit record. Once submitted you can not edit record?";
		ans = confirm(msg);
		return ans;
	}

	$(function() {
		$(document).ready(
				function() {

					$('#child_info_2').hide();
					$('#child_info_3').hide();

					$('#childCount')
							.change(
									function() {
										if ($('#childCount option:selected')
												.text() == "Twins") {
											$('#child_info_1').show();
											$('#child_info_2').show();
											$('#child_info_3').hide();
										} else if ($(
												'#childCount option:selected')
												.text() == "Triplets") {
											$('#child_info_1').show();
											$('#child_info_2').show();
											$('#child_info_3').show();
										} else if ($(
												'#childCount option:selected')
												.text() == "Single") {
											$('#child_info_1').show();
											$('#child_info_2').hide();
											$('#child_info_3').hide();
										}
									});
				});
	});
</script>
<style type="text/css">
checkbox.small {
	display: inline-block;
	width: 75px;
	height: 28px;
	padding: 4px;
	margin-bottom: 9px;
	font-size: 13px;
	line-height: 18px;
	color: #555555;
	border: 1px solid #ccc;
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	border-radius: 3px;
}

div.two_col_left_box {
	float: left;
	padding: 0px;
	width: 380px;
	border: 0px solid gray;
}

div.two_col_right_box {
	float: right;
	padding: 0px;
	width: 380px;
	border: 0px solid gray;
}

div.three_col_left_box {
	float: left;
	padding: 0px;
	width: 270px;
	border: 0px solid gray;
}

div.three_col_mid_box {
	float: left;
	padding: 0px;
	width: 270px;
	border: 0px solid gray;
}

div.three_col_mid_box_half {
	float: left;
	padding: 0px;
	margin-left: 10px;
	width: 80px;
	border: 0px solid gray;
}

div.three_col_right_box {
	float: left;
	padding: 0px;
	width: 220px;
	border: 0px solid gray;
}

div.form_row {
	width: 860px;
	padding: 1px;
	overflow: hidden;
	border: 0px solid gray;
	margin-top: 5px;
}

div.section_header {
	width: 840px;
	height: 26px;
	color: #FFFAFA;
	display: table-cell;
	vertical-align: middle;
	background-color: #545454;
	padding: 0 5px 2px;
	font-family: serif;
	font-size: 14px;
}
</style>
</head>

<body class="createDeath" />

<div class="span12">
	<s:form name="createDeathForm" action="createDeath.action"
		enctype="multipart/form-data" method="post" validate="true"
		cssClass="well form-vertical">

		<div class="section_header">
			<b>DEATH INFORMATION</b>
		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<fieldset class="control-group">
					<label class="control-label"> Date of Death:</label>
					<div class="controls">
						<input id="deathdate" name="death.deathDateString" type="text"
							readonly="readonly" size="25" title="date"
							contenteditable="false" value="${death.deathDateString}">
						<a href="javascript:NewCal('deathdate','ddmmmyyyy',false,24)"><img
							src="images/cal.gif" width="16" height="16" border="0"
							alt="Pick date and time"> </a>
					</div>
				</fieldset>
			</div>

			<div class="three_col_mid_box">
				<s:textfield key="death.personName" required="true" title="Full name of the deceased"/>
			</div>

			<div class="three_col_right_box">
				<s:select name="death.sex" key="death.sex"
					list="#{'Male':'Male','Female':'Female'}" headerKey="-1"
					headerValue="--- Select ---" required="true"></s:select>
			</div>

		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<s:textfield key="death.age" required="true" title="If the deceased was over 1 year of age, give age in completed years. If the deceased was below 1 year, give age in months, and if below 1 month, give age in completed number of days, and if below 1 day, in hours"/>
			</div>

			<div class="three_col_mid_box">
				<s:select name="death.ageType" key="death.ageType"
					list="#{'Years':'Years','Months':'Months','Days':'Days','Hours':'Hours'}"
					required="true"></s:select>
			</div>

			<div class="three_col_right_box"></div>
		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<s:select name="death.deathPlaceType" key="death.deathPlaceType"
					list="#{'Hospital':'Hospital','House':'House','Other':'Other'}"
					headerKey="-1" headerValue="--- Select ---" required="true"></s:select>
			</div>

			<div class="three_col_mid_box">
				<s:textfield key="death.placeDetails" required="true" title="Name/Address of hospital/house"/>
			</div>

			<div class="three_col_right_box"></div>
		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<s:textfield key="death.informantName" />
			</div>

			<div class="three_col_mid_box">
				<s:textfield key="death.informantAddress" />
			</div>

			<div class="three_col_right_box"></div>
		</div>


		<div class="section_header">
			<b>INFORMATION FOR STATISTICAL DATA COLLECTION</b>
		</div>
		<div class="form_row">
			<div class="three_col_left_box">
				<s:textfield key="death.residencePlaceName"
					title="Name of town/village where the deceased used to live" required="true"/>
			</div>

			<div class="three_col_mid_box">
				<s:select name="death.residencePlaceType"
					key="death.residencePlaceType" list="resPlaceTypes" headerKey="-1"
					headerValue="--- Select ---" required="true"></s:select>
			</div>

			<div class="three_col_right_box">
				<s:textfield key="death.district" required="true" />
			</div>
		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<s:textfield key="death.state" required="true" />
			</div>

			<div class="three_col_mid_box">
				<s:textfield key="death.occupation"
					title="If no occupation, write NIL"/>
			</div>

			<div class="three_col_right_box">
				<s:select name="death.attentionType" key="death.attentionType"
					list="attentionTypes" headerKey="-1" headerValue="--- Select ---"
					required="true" title="Type of medical attention received before death"></s:select>
			</div>
		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<s:select name="death.familyReligion" key="death.familyReligion"
					list="religions" headerKey="-1" headerValue="--- Select ---"
					required="true"></s:select>
			</div>

			<div class="three_col_mid_box"></div>
			<div class="three_col_right_box"></div>
		</div>

		<div class="section_header">
			<b>MEDICAL HISTORY INFORMATION</b>
		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<s:textfield key="death.deathCause" required="true"
					title="For all death irresprctive of whether medically certified or not" />
			</div>

			<div class="three_col_mid_box">
				<s:select name="death.medicallyCertified"
					key="death.medicallyCertified" list="#{'Yes':'Yes','No':'No'}"
					headerKey="-1" headerValue="--- Select ---" required="true"></s:select>
			</div>
			<div class="three_col_right_box">
				<s:select name="death.drinkAlcoholSince"
					key="death.drinkAlcoholSince" list="yearsList" headerKey="-1"
					headerValue="--- Select ---"></s:select>
			</div>
		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<s:select name="death.smokingSince" key="death.smokingSince"
					list="yearsList" headerKey="-1" headerValue="--- Select ---"></s:select>
			</div>

			<div class="three_col_mid_box">
				<s:select name="death.chewSince" key="death.chewSince"
					list="yearsList" headerKey="-1" headerValue="--- Select ---"
					title="Tobacco in any form"></s:select>
			</div>
			<div class="three_col_right_box">
				<s:select name="death.chewAercanutSince"
					key="death.chewAercanutSince" list="yearsList" headerKey="-1"
					headerValue="--- Select ---"
					title="in any form including pan masala"></s:select>
			</div>
		</div>

		<div class="form_row">
			<div class="three_col_left_box">
				<s:select name="death.femaleDeathAroundPregnancy"
					key="death.femaleDeathAroundPregnancy"
					list="#{'Yes':'Yes','No':'No','Not Applicable':'Not Applicable'}"
					headerKey="-1" headerValue="--- Select ---"></s:select>

			</div>

			<div class="three_col_mid_box"></div>
			<div class="three_col_right_box"></div>
		</div>






		<fieldset class="form-actions">
			<s:submit key="button.submit" method="save"
				cssClass="btn btn-primary" theme="simple" />

			<s:submit key="button.cancel" method="cancel" cssClass="btn"
				theme="simple" />
		</fieldset>
	</s:form>

</div>

